<%-- 
    Document   : manager
    Created on : Sep 24, 2013, 11:22:24 AM
    Author     : Lambach
--%>
<%@page import="com.apt.bean.User"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib  prefix="showuser" uri="/WEB-INF/tlds/tag_showalluser.tld"  %>
<%@taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@taglib  prefix="sendemail" uri="/WEB-INF/tlds/send_email.tld" %>
<%@taglib  prefix="showAccdisable" uri="/WEB-INF/tlds/disable_tag.tld" %>
<%@taglib  prefix="professional" uri="/WEB-INF/tlds/professionaltag_library.tld" %>
<%@taglib  prefix="hobbies" uri="/WEB-INF/tlds/hobbiestag_library.tld" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Admin Home Page</title>
        <link rel="stylesheet" href="resources/css/reset.css" type="text/css" media="screen" />
        <link rel="stylesheet" href="resources/css/style.css" type="text/css" media="screen" />
        <link rel="stylesheet" href="resources/css/invalid.css" type="text/css" media="screen" />
        <script type="text/javascript" src="resources/scripts/jquery-1.3.2.min.js"></script>
        <script type="text/javascript" src="resources/scripts/simpla.jquery.configuration.js"></script>
        <script type="text/javascript" src="resources/scripts/facebox.js"></script>
        <script type="text/javascript" src="resources/scripts/jquery.wysiwyg.js"></script>
        <script type="text/javascript" src="resources/scripts/jquery.datePicker.js"></script>
        <script type="text/javascript" src="resources/scripts/jquery.date.js"></script>

    </head>
    <body><div id="body-wrapper"> <!-- Wrapper for the radial gradient background -->
            <!--kiemtra quyen truy cap de dieu huong o day-->
            <c:set var="log"  value='<%=session.getAttribute("adminUser")%>'/>
            <c:set var="select" value='<%=request.getAttribute("option")%>'/>
            <html:errors/>
            <html:messages id="anmss" ></html:messages>
            <c:set var="log"  value='<%=session.getAttribute("Account")%>'/>
            <c:choose>
                <c:when test="${log!=null}">
                    <c:set var="option" value='<%=request.getParameter("menu")%>'/>
                    <div id="sidebar"><div id="sidebar-wrapper"> <!-- Sidebar with logo and menu -->

                            <h1 id="sidebar-title"><a href="#">Admin Home Page </a></h1>

                            <!-- Logo (221px wide) -->
                            <div align="center"> <a href="#"><img id="logo" src="resources/images/logo_admin.gif" alt="Admin Home Page" /></a> </div>

                            <!-- Sidebar Profile links -->
                            <div id="profile-links">

                                Hello, <a href="#" title="Edit your profile"></a>, you have <a href="#messages" rel="modal" title="3 Messages">3 Messages</a><br />
                                <br />
                                <a href="index.jsp" title="View the Site" >View the Site</a> | <a href="authenticate.jsp" title="Sign Out" onclick="<%application.removeAttribute("admin");%>" >Sign Out</a>
                            </div>

                            <ul id="main-nav">  <!-- Accordion Menu -->

                                <li>
                                    <a href="#" class="nav-top-item "> <!-- class="nav-top-item current"Add the class "current" to current menu item -->
                                        Member Manager
                                    </a>
                                    <ul>
                                        <li><a  href="Navigation?menu=1" > All Member  </a></li> <!-- class="current"Add class "current" to sub menu items also -->  
                                        <li><a href="Navigation?menu=8">Manage Account Disable </a></li>
                                        <li><a href="Navigation?menu=2">Manage Account Expired</a></li>

                                    </ul>
                                </li>
                                <li>
                                    <a href="#" class="nav-top-item">
                                        Feedback 
                                    </a>
                                    <ul>
                                        <li><a href="Navigation?menu=9" >List Feedback</a></li>
                                    </ul>
                                </li>
                                <li>
                                    <a href="#" class="nav-top-item">
                                        Advertisement
                                    </a>
                                    <ul>
                                         <li><a href="advertisements.jsp?menu=3&id=${adminID}" >List Advertisement</a></li>
                                        <li><a href="advertisements.jsp?menu=4&id=${adminID}">Advertisement Enable </a></li>
                                        <li><a href="advertisements.jsp?menu=5&id=${adminID}">Advertisement Disable</a></li>

                                    </ul>
                                </li>

                                <li>
                                    <a href="#" class="nav-top-item">
                                        Settings
                                    </a>
                                    <ul>
                                        <li><a href="Navigation?menu=6">Create New Admin Account</a></li>
                                        <li><a href="Navigation?menu=7">Update Admin Account </a></li>

                                    </ul>
                                </li>
                                <li>
                                    <a href="#" class="nav-top-item">
                                        Countries
                                    </a>
                                    <ul>
                                        <li><a href="Navigation?menu=12&id=${adminID}" >Manager Countries</a></li>
                                    </ul>
                                </li>
                                <li>
                                    <a href="#" class="nav-top-item">
                                        Caste
                                    </a>
                                    <ul>
                                        <li><a href="Navigation?menu=13&id=${adminID}" >Manager Caste</a></li>
                                    </ul>
                                </li>
                                <li>
                                    <a href="#" class="nav-top-item">
                                        Professional
                                    </a>
                                    <ul>
                                        <li><a href="Navigation?menu=14&id=${adminID}" >Manager Professional </a></li>
                                    </ul>
                                </li>
                                <li>
                                    <a href="#" class="nav-top-item">
                                        Religion
                                    </a>
                                    <ul>
                                        <li><a href="Navigation?menu=15&id=${adminID}" >Manager Religion </a></li>
                                    </ul>
                                </li>
                                <li>
                                    <a href="#" class="nav-top-item">
                                        Preferences
                                    </a>
                                    <ul>
                                        <li><a href="Navigation?menu=16&id=${adminID}" >Manager Preferences </a></li>
                                    </ul>
                                </li>
                                <li>
                                    <a href="#" class="nav-top-item">
                                        Payments
                                    </a>
                                    <ul>
                                        <li><a href="Navigation?menu=17&id=${adminID}" >Manager Payments </a></li>
                                    </ul>
                                </li>
                            </ul> <!-- End #main-nav -->

                        </div></div> <!-- End #sidebar -->

                    <div id="main-content"> <!-- Main Content Section with everything -->

                        <noscript> <!-- Show a notification if the user has disabled javascript -->
                            <div class="notification error png_bg">
                                <div>
                                    Javascript is disabled or is not supported by your browser. Please <a href="http://browsehappy.com/" title="Upgrade to a better browser">upgrade</a> your browser or <a href="http://www.google.com/support/bin/answer.py?answer=23852" title="Enable Javascript in your browser">enable</a> Javascript to navigate the interface properly.
                                </div>
                            </div>
                        </noscript>

                        <!-- Page Head -->
                        <h2>Welcome </h2>
                        <p id="page-intro">What would you like to do?</p>

                        <ul class="shortcut-buttons-set">

                            <li><a class="shortcut-button" href="#"><span>
                                        <img src="resources/images/icons/pencil_48.png" alt="icon" /><br />
                                        Write an Article
                                    </span></a></li>

                            <li><a class="shortcut-button" href="#"><span>
                                        <img src="resources/images/icons/paper_content_pencil_48.png" alt="icon" /><br />
                                        Create a New Page
                                    </span></a></li>

                            <li><a class="shortcut-button" href="#"><span>
                                        <img src="resources/images/icons/image_add_48.png" alt="icon" /><br />
                                        Upload an Image
                                    </span></a></li>

                            <li><a class="shortcut-button" href="#"><span>
                                        <img src="resources/images/icons/clock_48.png" alt="icon" /><br />
                                        Add an Event
                                    </span></a></li>

                            <li><a class="shortcut-button" href="#messages" rel="modal"><span>
                                        <img src="resources/images/icons/comment_48.png" alt="icon" /><br />
                                        Open Modal
                                    </span></a></li>

                        </ul><!-- End .shortcut-buttons-set -->

                        <div class="clear"/>
                        <div class="content-box-header">
                            <h3 id="contenttitle" > Edit Hobbies Model : <%=request.getParameter("liking_Model_Name")%>  </h3>
                            <div class="clear"></div>
                        </div>
                        <div class="content-box-content">
                            <div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
                                <table id="table_us" >
                                    <!--update-->
                                    <thead>
                                        <tr>
                                            <!--<th><input class="check-all" type="checkbox" /></th>-->
                                            <th> Hobbies Model Name</th>
                                            <th>List Hobbies Name</th>
                                            <th>Hobbies Current Status</th>
                                            <th>Hobbies Setting</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <!--ba tham so dau vao--> 
                                        <c:set var="pageno" value='<%=request.getParameter("pageno")%>'/>
                                        <c:set var="modelname" value='<%=request.getParameter("liking_Model_Name")%>'/>
                                        <c:set var="modelid" value='<%=request.getParameter("liking_Id")%>'/>
                                        <hobbies:LikingTagHandler modlename="${modelname}" page="${pageno}" liking_Model_Id="${modelid}"/>

                                    </tbody>

                                </table>
                                <div class="clear"/>
                                <div class="content-box-header">
                                    <h3 id="contenttitle" >  </h3>
                                    <a href="#" class="button" onclick="history.back();">Back</a>
                                    <div class="clear"></div>
                                </div>
                                <div class="clear"/>
                                <div class="content-box-header">
                                    <h3 id="contenttitle" > Add New Hobbies for: <%=request.getParameter("liking_Model_Name")%> </h3>
                                    <h3 id="Message" style="color: #d60001">  </h3>
                                    <div class="clear"></div>
                                </div>

                                <!--them moi-->
                                <table border="1">
                                    <thead>
                                        <tr>
                                            <th>Hobbies_Model_Name</th>
                                            <th>Hobbies Name </th>

                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr> 
                                            <!--dung servlet-->
                                    <form action="NewLiking_Servlet" name="frmcreate" method="get" onsubmit="return checkhobbies()"> 
                                        <td> <%=request.getParameter("liking_Model_Name")%></td>
                                        <td><input type="text" id="liking1" name="hobbiename"/>
                                            <input type="hidden"  name="liking_Model_Id" value="${modelid}"/>
                                            <input type="hidden"  name="pageno" value="${pageno}"/>
                                            <input type="hidden"  name="liking_Id" value="${modelid}"/>
                                            <input type="hidden"  name="liking_Model_Name" value="${modelname}"/>
                                            <input type="submit" class="button" value="Add"/></td>
                                    </form>
                                    </tr>

                                    </tbody>
                                </table>


                            </div> <!-- End #tab1 -->

                        </div> <!-- End .content-box-content -->
                        <div id="footer">
                            <small> <!-- Remove this notice or replace it with whatever you want -->
                                &#169; Copyright 2009 Your Company | Powered by <a href="http://themeforest.net/item/simpla-admin-flexible-user-friendly-admin-skin/46073">Simpla Admin</a> | <a href="#">Top</a>
                            </small>
                        </div><!-- End #footer -->

                    </div> <!-- End #main-content -->

                </div>
                <!--Mess error?-->
                <c:set var="ok" value='<%=request.getParameter("ok")%>'/>
                <c:if test="${ok==1}">
                    <script type="text/javascript">
                                        alert("Update Hobbies success ");
                    </script>
                </c:if>
                <c:if test="${ok==0}">
                    <script type="text/javascript">
                        alert("Hobbies Update failed! Name of Liking options exist ");
                    </script>
                </c:if>

                <c:set var="disable" value='<%=request.getParameter("disable")%>'/>
                <c:if test="${disable==0}">
                    <script type="text/javascript">
                        alert("Hobbies Disable  failed! ");
                    </script>
                </c:if>
                <c:set var="enable" value='<%=request.getParameter("enable")%>'/>
                <c:if test="${enable==0}">
                    <script type="text/javascript">
                        alert("Hobbies Enable  failed! ");
                    </script>
                </c:if>

                <c:set var="create" value='<%=request.getParameter("create")%>'/>
                <c:if test="${create==1}">
                    <script type="text/javascript">
                        alert("Create a New Hobbies success ");
                    </script>
                </c:if>
                <c:if test="${create==0}">
                    <script type="text/javascript">
                        alert("Create a New Hobbies Fail !preference name already exists ");
                    </script>
                </c:if>

            </c:when>
            <c:otherwise ><c:out value="<h1>User Invalidate !</h1>"/>
                <h1 style=" font-size: larger;color: #ffffff"><c:out value="${log2}"/></h1>  </c:otherwise>
        </c:choose>
        <script type="text/javascript">
            function checkhobbies() {
                var l1 = this.document.getElementById("liking1").value;

                if (l1 === "" || l1.length <= 5) {
                    this.document.getElementById("Message").innerHTML = "Please Enter your professiona and length more than 5 character"
                    this.document.getElementById("liking1").focus();
                    return false;
                }
            }
        </script>
    </body>
</html>

<!--                                    <tr>
                                        <td><input type="text" name="hobbmodle"/></td>
                                        <td><input type="text" name="hobbiename"</td> 
                                        <td><a href="#">Update</a><span>    ...       </span><a href="#" >Disable</a><span>    ...      </span><a href="#" >Enable</a></td>
                                    </tr>-->